import youkelist from "../src/data/youke.json"
import fuwulist from "../src/data/fuwu.json"
import liaotianlist from "../src/data/liaotian.json"
export default {
    "GET /youkelist":youkelist,
    "GET /fuwulist":(req:any,res:any)=>{
        const {search}=req.query
        if (search) {
            const arr=fuwulist.data.filter((item:any)=>{
                return item.kefu_name.includes(search)
            })
            res.send(arr)
        }else{
            res.send(fuwulist)
        }
    },
    "GET /liaotianlist":(req:any,res:any)=>{
        const {search}=req.query
        if (search) {
            const arr=liaotianlist.data.filter((item:any)=>{
                return item.from_name.includes(search)
            })
            res.send(arr)
        }else{
            res.send(liaotianlist)
        }
        
    },
}
